<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="https://www.facebook.com/2008/fbml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport">
<meta content="yes" name="apple-mobile-web-app-capable">
<meta content="telephone=no" name="format-detection">
<title>FB test for すまーとふぉん</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
<style>
body {
font-size: 82%;
}

#log {
background-color: #CCCCCC;
border: 1px solid;
}
</style>

<script>
(function() {
    $(function() {

        $('body').append('<div id="fb-root"></div>');

        $.getScript(document.location.protocol + '//connect.facebook.net/ja_JP/all.js', function() {

            var log = $('#log');

            FB.init({
                appId: '472363269453205',
                status: true,
                xfbml: true,
                channelUrl:'http://ak24.googlecode.com/svn/trunk/sp/index.html',
                oauth : true, cookie : true
		    });
//            FB.init({appId: '283871094963977', status: true, xfbml: true,oauth : true, cookie : true});

            FB.getLoginStatus(function(response) {
                console.log(response);

            });

            FB.Event.subscribe('edge.create', function(response) {
                log.html(log.html() + '「いいね」On<br>');
                console.log(response);
            });

            FB.Event.subscribe('auth.login', function(response) {
                log.html(log.html() + 'login<br>');
                console.log(response);
            });

            FB.Event.subscribe('auth.logout', function(response) {
                log.html(log.html() + 'logout<br>');
                console.log(response);
            });

            FB.Event.subscribe('auth.authResponseChange', function(response) {
                log.html(log.html() + 'auth.authResponseChange<br>');
                console.log(response);
            });

            FB.Event.subscribe('auth.statusChange', function(response) {
                log.html(log.html() + 'auth.statusChange<br>');
                console.log(response);
            });

            FB.Event.unsubscribe('edge.create', function(response) {
                console.log(response);
            });

            FB.Event.subscribe('edge.remove', function(response) {
                log.html(log.html() + '「いいね」Off<br>');
                console.log(response);
            });

            $('#fbLogout').click(function() {
                FB.logout(function(response) {
                    console.log(response);
                });
            });

        });
    
    })
})();
</script>

</head>
<body>
  <p><a href="https://www.facebook.com/pages/24TryCatch/484211364934419">「いいね」テスト</a></p>
    <div id="contens">
        <p><fb:like href="http://www.facebook.com/pages/24TryCatch/484211364934419"></fb:like></p>
        <p><fb:login-button></fb:login-button></p>
        <p><input type="button" id="fbLogout" value="ろぐあうと"/></p>
    </div>


    <div id="log"></div>
		
</body>
</html>
